//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package code.whmmm.util.simple;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class MD5Util {
    public MD5Util() {
    }

    public static String getMd5(String srcStr) {
        if (srcStr == null) {
            srcStr = "";
        }

        Object var1 = null;

        byte[] secretBytes;
        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            md.update(srcStr.getBytes());
            secretBytes = md.digest();
        } catch (NoSuchAlgorithmException var4) {
            throw new RuntimeException("没有md5这个算法！");
        }

        StringBuilder md5code = new StringBuilder((new BigInteger(1, secretBytes)).toString(16));

        for (int i = 0; i < 32 - md5code.length(); ++i) {
            md5code.insert(0, "0");
        }

        return md5code.toString();
    }
}
